package com.production.CoursePlatform.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.production.CoursePlatform.entity.CurriculumResources;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CurriculumResourcesMapper extends BaseMapper<CurriculumResources> {
    @Insert("INSERT INTO curriculum_resources (ct_id, rs_category, attachment) VALUES (#{ctID}, #{rsCategory}, #{attachment})")
    public int insertWithoutRsID(CurriculumResources resource);

    // 按照ctID查找资源
    @Select("SELECT * FROM curriculum_resources WHERE ct_id = #{ctID}")
    public List<CurriculumResources> selectByCtID(@Param("ctID") int ctID);
}

